<template>
	<div style="position: relative;">
		<Affix :offset-top="20" style="z-index: 10;position: absolute;right: 3%;">
			<Tooltip content="返回上一页" theme="light">
	    		<Button @click="btnback" style="right: 6%;z-index: 100;" type="ghost" shape="circle" icon="iconfont alicon-back_android_light" ></Button>
	    	</Tooltip>
		</Affix>
		
		<div style="margin:20px;background-color: #f5f5f5;padding: 20px;">
			<Row >
		        <Col span="24" style="text-align: left;">
					<span style="font-size: 18px;color: #1a1a1a;font-weight: 540;">评价名称：{{excelname}}</span>
				</Col>
			</Row>
			<Row style="margin:15px 0px 0px 0px;color: #666666;">
		        <Col span="6" style="text-align: left;">
					<span style="font-size: 16px;">年级：{{gradeName}}</span>
				</Col>
				<Col span="6" style="text-align: left;">
					<span style="font-size: 16px;">基数：{{baseExamName}}</span>
				</Col>
				<Col span="6" style="text-align: left;">
					<span style="font-size: 16px;">本次：{{thisExamName}}</span>
				</Col>
				<Col span="6" style="text-align: left;">
					<span style="font-size: 16px;">时间：{{createTime}}</span>
				</Col>
			</Row>
		</div>
		
		<Tabs v-model="value" @on-click="clickTab" style="padding-top: 0px ;">
			<TabPane label="汇总统计" v-if="summarystatistics" name="summarystatistics">
	        	<Summarystatistics></Summarystatistics>
	        </TabPane>
			<TabPane label="教师得分" v-if="teacherscore" name="teacherscore">
	        	<teacherscore></teacherscore>
	        </TabPane>
	        <TabPane label="详细指标得分" v-if="true" name="detailedindexscore">
	        	<Detailedindexscore></Detailedindexscore>
	        </TabPane>
	        
			
			<TabPane label="成绩明细" v-if="resultbreakdown" name="resultbreakdown">
	        	<resultbreakdown v-if='resultbreakdownshow'></resultbreakdown>
	       	</TabPane>
	       
	      	
	    </Tabs>
	   
	    <Spin size="large" fix v-if="menushow"></Spin>
	</div>
</template>

<script>
	import { getsessionstorage } from '@/components/js/Localstorage'
	import api from "@/components/js/Apidomain.js"
	import Summarystatistics from '@/components/performance/performancequery/middle/excelpart/Summarystatistics'
	import Resultbreakdown from '@/components/performance/performancequery/middle/excelpart/Resultbreakdown'
	import Teacherscore from '@/components/performance/performancequery/middle/excelpart/Teacherscore'
	
	import Detailedindexscore from '@/components/performance/performancequery/middle/Detailedindexscore'
	export default{
		data(){
			return{
				value:"summarystatistics",
				menushow:true,			//菜单加载中显示
				
				//tab上面控制显示隐藏
				summarystatistics:true,
				resultbreakdown:false,
				teacherscore:true,
				
				//点击tab中的栏目才去加载那页，加快速度
				resultbreakdownshow:false,
				
				excelname:"",			//查询的名字
				gradeName:"",			//查询的年级
				baseExamName:"",		//查询的基数考试名字
				thisExamName:"",		//查询的本次考试名字
				createTime:"",			//查询的评价时间	
				
			}
		},
		components:{
			Summarystatistics,
			Resultbreakdown,
			Teacherscore,
			
			Detailedindexscore
		},
		created(){
			this.excelname = getsessionstorage('excelname')
			this.gradeName = getsessionstorage('gradeName')
			this.baseExamName = getsessionstorage('baseExamName')
			this.thisExamName = getsessionstorage('thisExamName')
			this.createTime = getsessionstorage('createTime')
			this.getsecondmenupermission();
		},
		methods:{
			clickTab:function(value){
				if(value == "resultbreakdown"){
					this.resultbreakdownshow = true;
				}
			},
			btnback:function(){
				this.$router.back(-1)
			},
			getsecondmenupermission:function(){
				let sessionroleid = getsessionstorage('roleid');
				if(sessionroleid){
					var senddata = {
						"role":sessionroleid,
						"ress":['resultbreakdown','teacherscore']
					}
					this.menushow = true;
					var self = this;
	            	let url = api.apidomain+'/tqes/web/sysRes/getResPowerByRole';
	            	this.$http.post(url,senddata).then(function(response) {
						if(response.data.success == true){
//							////console.log(response.data.data)
							
							
							self.resultbreakdown = response.data.data.resultbreakdown,
							self.teacherscore = response.data.data.teacherscore
							
							self.menushow = false;
							
		            }else if(response.data.success == false){
		            		self.$Message.error({
								content: response.data.msg,
								duration: 10,
								closable: true
							});
		            	}
		            	
					})
					.catch(function(error) {
						self.$Message.error({
							content: '系统发生错误：错误码00210',
							duration: 10,
							closable: true
						});
					});
				}	
			},
		},
		
	}
</script>

<style>
	.alicon-back_android_light{
		margin-top:4px;
	}
</style>